﻿@model YQBlog.Models.ArticleModel
@using res = Resource.Views.Admin.Admin;
@{YQBlog.General.GeneralConfigInfo ci = ViewBag.CI as YQBlog.General.GeneralConfigInfo;}
@section Css{
    <link href="@Url.Content("~/Content/css/uploadify.css")" rel="stylesheet" type="text/css" />
}
@section MenuInfo{
<ul> 
    <li>@Html.ActionLink("-"+ res.ManagementHome+" -", "Index", "Admin")</li>
    <li class="selected">
        <span class="selected-arrow">&nbsp;</span>
        <a href="###">- @res.ContentManagement -</a>
        <ul>
            <li id="t1">@Html.ActionLink(res.Article, "AdminArticle", "Admin", new { tid = 1 }, null)</li>
            <li id="t2">@Html.ActionLink(res.SinglePage, "AdminArticle", "Admin", new { tid = 2 }, null)</li>
            <li id="t5" class="v10">@Html.ActionLink(res.Posts, "AdminArticle", "Admin", new { tid = 5 }, null)</li>
            <li id="t4" class="selected">@Html.ActionLink(res.Album, "AdminArticle", "Admin", new { tid = 4 }, null)</li>
            <li id="t6">@Html.ActionLink(res.Message, "AdminArticle", "Admin", new { tid = 6 }, null)</li>
            <li id="l1">@Html.ActionLink(res.Comment, "AdminArticle", "Admin", new { layer = 1 }, null)</li>
            <li id="t7">@Html.ActionLink(res.CustomArea, "AdminArticle", "Admin", new { tid = 7 }, null)</li>
            <li id="t8">@Html.ActionLink(res.CustomGlobalArea, "AdminArticle", "Admin", new { tid = 8 }, null)</li>
        </ul>
    </li>
    <li>@Html.ActionLink("-" + res.Configuration + " -", "AdminBaseConfig", "Admin")</li>
    <li>@Html.ActionLink("-" + res.UserManagement + " -", "AdminUserList", "Admin")</li>
</ul>
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.uploadify-3.1.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.dragsort-0.5.1.min.js")" type="text/javascript"></script>

<div id="mainContent">
        <div id="leftBox">
          <div id="pagePath">
          @res.Location：@res.AddAlbum
          </div>
          <div id="forms" class="contentBox">
            <div class="contentBoxTop">
              <h3>@res.AddAlbum</h3>
                <ul class="switcherTabs">
                    <li class=""><a tar="#box-2">-@res.SEO-</a></li>
                    <li class="selected"><a tar="#box-1">-@res.BasicInformation- </a></li>
                </ul>
            </div>
            <div class="innerContent">
@using (Html.BeginForm("AdminAdd", "Admin"))
{
            <div id="box-1" class="tab1-box" style="display: block;">
            <div class="label">
               <div class="editor-label">
                    @Html.LabelFor(m => m.CateId)
                </div>
                <div class="editor-field">
                    @Html.DropDownList("CateId")
                    <!--@Html.DropDownListFor(m => m.CateId, (SelectList)ViewData["CateId"])
                    @Html.ValidationMessageFor(m => m.CateId)-->
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Title)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.Title, new { style = "width: 850px;" })
                    @Html.ValidationMessageFor(m => m.Title)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Summary)
                    <span id="SummaryTxtCount">(300)</span>
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.Summary, new { style = "width: 850px; height: 50px" })
                    @Html.ValidationMessageFor(m => m.Summary)
                </div>
            </div>

<input type="button" onclick="GetPhotos()" style="display:none;"/>
<div class="photoUpload">
    <div class="photoDisplayChange">@res.Cover_Tip @res.AspectRatio：<a href="###">4X</a> <a href="###">7X</a> <a href="###">10X</a></div>
    <p><input type="file" name="file_upload" id="file_upload_1" /></p>	
    <div id="retip"></div>
    <ul class="photobox box">
    </ul>
</div>

            <div class="label"  style="display:none;">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Content)
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.Content, new { style = "width: 850px; height: 350px" })
                    @Html.ValidationMessageFor(m => m.Content)
                </div>
            </div>

            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Tags)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.Tags, new { style = "width: 850px;" })
                    @Html.ValidationMessageFor(m => m.Tags)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(model => model.ReplyPermit)
                </div>
                <div class="editor-field radios">
                    <input type="radio" value="1" name="ReplyPermit" id="ReplyPermit_y" checked="checked" />
                    <label for="ReplyPermit_y">
                        @res.AllowComments</label>
                    <input type="radio" value="2" name="ReplyPermit" id="ReplyPermit_n" />
                    <label for="ReplyPermit_n">
                        @res.NoComments</label>
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(model => model.Status)
                </div>
                <div class="editor-field radios">
                    <input type="radio" value="1" name="Status" id="Status_y" checked="checked" />
                    <label for="Status_y">
                        @res.ImmediateRelease</label>
                    <input type="radio" value="2" name="Status" id="Status_n" />
                    <label for="Status_n">
                        @res.SaveDraft</label>
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(model => model.IsCommend)
                </div>
                <div class="editor-field radios">
                    <input type="radio" value="1" name="IsCommend" id="IsCommend_y"/>
                    <label for="IsCommend_y">
                        @res.Recommend</label>
                    <input type="radio" value="2" name="IsCommend" id="IsCommend_n" checked="checked" />
                    <label for="IsCommend_y">
                        @res.NoRecommended</label>
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(model => model.IsTop)
                </div>
                <div class="editor-field radios">
                    <input type="radio" value="1" name="IsTop" id="IsTop_y"/>
                    <label for="IsTop_y">
                        @res.Top</label>
                    <input type="radio" value="2" name="IsTop" id="IsTop_n"  checked="checked" />
                    <label for="IsTop_n">
                        @res.NoSticky</label>
                </div>
            </div>

            </div><!--end of #box-1-->
            <div style="display:none" id="box-2" class="tab1-box">

            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.SeoTitle)
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.SeoTitle, new { style = "width: 800px; height: 30px" })
                    @Html.ValidationMessageFor(m => m.SeoTitle)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.SeoDescription)
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.SeoDescription, new { style = "width: 800px; height: 50px" })
                    @Html.ValidationMessageFor(m => m.SeoDescription)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.Seokeywords)
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.Seokeywords, new { style = "width: 800px; height: 50px" })
                    @Html.ValidationMessageFor(m => m.Seokeywords)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.SeoMetas)
                </div>
                <div class="editor-field clstxtarea">
                    @Html.TextAreaFor(model => model.SeoMetas, new { style = "width: 800px; height: 80px" })
                    @Html.ValidationMessageFor(m => m.SeoMetas)
                </div>
            </div>
            <div class="label">
                <div class="editor-label">
                    @Html.LabelFor(m => m.ReName)
                </div>
                <div class="editor-field">
                    @Html.TextBoxFor(m => m.ReName, new { style = "width: 800px;" })
                    @Html.ValidationMessageFor(m => m.ReName)
                </div>
            </div>

            </div><!--end of #box-2-->
                <p>
			    <input type="image" src="/Content/image/admin/bt_submit.gif" name="BtnSubmit" id="BtnSubmit"/>
                </p>
}
            </div>
          </div>
<hr>
          <div class="errorBox"><div class="errorBoxTop">&nbsp;</div>
              <div class="msgBoxContent errorIcon">
                <p>Error. Item update failed. </p>
                <p>Details for the error goes here (If you need to).</p>
              </div>
          </div>
          <div class="successBox">
          <div class="successBoxTop">&nbsp;</div>
              <div class="msgBoxContent successIcon">
              <p>Success! Item updated.</p>
              </div>
          </div>
          <hr>
      </div><!-- end of #leftBox -->
              
  </div><!-- end of #content -->


<script type="text/javascript">
    $(function () {
        $(".photobox").dragsort({ dragSelector: "li", dragBetween: false, placeHolderTemplate: "<li></li>" });

        $("#Content").val("[]");

        $(".switcherTabs li").click(function () {
            var tar = $(this).find("a").attr("tar");
            $(this).addClass("selected").siblings("li").removeClass("selected");
            $(".tab1-box").hide();
            $(tar).show();
        });

        $("#file_upload_1").uploadify({
            height: 30,
            swf: '/Content/uploadify-v3.1/uploadify.swf',
            uploader: '/Uploadify/Upload/',
            width: 120,
            buttonText: '@(res.SelectPhotos)',
            fileTypeDesc: '.jpg,.gif,.png',
            fileTypeExts: '*.jpg;*.gif;*.png',
            onUploadSuccess: UploadResultFun
        });

        $("#BtnSubmit").click(function () {
            if (/^[0-9]+$/.test($("#ReName").val())) {
                alert("@res.PageRenameTip");
                return false;
            }
            GetPhotos();
            if ($("#Content").val() == "[]") {
                alert("@(res.Upload_Tip)"); return false;
            }
        });
    });
</script> 
